<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('运行任务日志列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>任务配置id：</label>
                                <input type="text" name="jobConfigId"/>
                            </li>
                            <li>
                                <label>任务名称：</label>
                                <input type="text" name="jobName"/>
                            </li>
                            <li>
                                <label>提交模式：</label>
                                <select name="deployMode"
									th:with="type=${@dict.getType('flink-config-deployMode')}">
										<option value="">所有</option>
										<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
											th:value="${dict.dictValue}"></option>
								</select>
                            </li>
                            <li>
                                <label>运行后的任务id：</label>
                                <input type="text" name="jobId"/>
                            </li>
                           
                            <li class="select-time">
                                <label>启动时间：</label>
                                <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginStartTime]"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endStartTime]"/>
                            </li>
                            <!-- <li class="select-time">
                                <label>启动时间：</label>
                                <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginEndTime]"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endEndTime]"/>
                            </li> -->
                            <li>
                                <label>任务状态：</label>
                                <select name="jobStatus"
									th:with="type=${@dict.getType('flink-config-status')}">
										<option value="">所有</option>
										<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
											th:value="${dict.dictValue}"></option>
								</select>
                            </li>
                            
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

<!--             <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="flink:log:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="flink:log:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div> -->
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('flink:log:edit')}]];
        var removeFlag = [[${@permission.hasPermi('flink:log:remove')}]];
        var deployModes = [[${@dict.getType('flink-config-deployMode')}]];
        var stats = [[${@dict.getType('flink-config-status')}]];
        var prefix = ctx + "flink/log";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "运行任务日志",
                columns: [{
                    checkbox: true
                },
                /* {
                    field: 'id', 
                    title: '任务状态',
                    visible: false
                }, */
                {
                    field: 'jobConfigId', 
                    title: '任务配置id'
                },
                {
                    field: 'jobName', 
                    title: '任务名称'
                },
                {
                    field: 'deployMode', 
                    title: '提交模式',
		        	formatter: function (value, row, index) {
		        		return $.table.selectDictLabel(deployModes, value);
		        	}
                },
                {
                    field: 'jobId', 
                    title: '运行后的任务id'
                },
                {
                    field: 'localLog', 
                    title: '启动时本地日志'
                },
                {
                    field: 'remoteLogUrl', 
                    title: '远程日志url的地址'
                },
                {
                    field: 'startTime', 
                    title: '启动时间'
                },
                {
                    field: 'endTime', 
                    title: '结束时间'
                },
                {
                    field: 'jobStatus', 
                    title: '任务状态',
		        	formatter: function (value, row, index) {
		        		return $.table.selectDictLabel(stats, value);
		        	}
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>